const fs = require("fs");
const path = require("path");
// 读取配置
const config = require("./mini-webpack-config.js");

// 主函数
function main() {
	let absPath = path.resolve(__dirname, config.entry);
	let entry = fs.readFileSync(absPath, "utf-8");
	console.log(entry);
	if(!fs.existsSync('./dist')) {
		fs.mkdirSync('dist');
	}
	fs.writeFileSync('./dist/main.js', entry);

}

main();